3.52 \(\int (a+b \tan (e+f x)) (c+d \tan (e+f x)) (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=161 \[ -\frac {\log (\cos (e+f x)) (a A d+a B c-a C d+A b c-b B d-b c C)}{f}+x (a (A c-B d-c C)-b (d (A-C)+B c))+\frac {d \tan (e+f x) (a B+A b-b C)}{f}-\frac {(-3 a C d-3 b B d+b c C) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac {b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f} \]

[Out]

(a*(A*c-B*d-C*c)-b*(B*c+(A-C)*d))*x-(A*a*d+A*b*c+B*a*c-B*b*d-C*a*d-C*b*c)*ln(cos(f*x+e))/f+(A*b+B*a-C*b)*d*tan
(f*x+e)/f-1/6*(-3*B*b*d-3*C*a*d+C*b*c)*(c+d*tan(f*x+e))^2/d^2/f+1/3*b*C*tan(f*x+e)*(c+d*tan(f*x+e))^2/d/f

________________________________________________________________________________________

Rubi [A]  time = 0.24, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {3637, 3630, 3525, 3475} \[ -\frac {\log (\cos (e+f x)) (a A d+a B c-a C d+A b c-b B d-b c C)}{f}-x (-a (A c-B d-c C)+b d (A-C)+b B c)+\frac {d \tan (e+f x) (a B+A b-b C)}{f}-\frac {(-3 a C d-3 b B d+b c C) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac {b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((b*B*c + b*(A - C)*d - a*(A*c - c*C - B*d))*x) - ((A*b*c + a*B*c - b*c*C + a*A*d - b*B*d - a*C*d)*Log[Cos[e
+ f*x]])/f + ((A*b + a*B - b*C)*d*Tan[e + f*x])/f - ((b*c*C - 3*b*B*d - 3*a*C*d)*(c + d*Tan[e + f*x])^2)/(6*d^
2*f) + (b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^2)/(3*d*f)

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3630

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])
^(n + 1))/(d*f*(n + 2)), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
 + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] &&  !LtQ[n, -1]

Rubi steps

\begin {align*} \int (a+b \tan (e+f x)) (c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac {b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}-\frac {\int (c+d \tan (e+f x)) \left (b c C-3 a A d-3 (A b+a B-b C) d \tan (e+f x)+(b c C-3 b B d-3 a C d) \tan ^2(e+f x)\right ) \, dx}{3 d}\\ &=-\frac {(b c C-3 b B d-3 a C d) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac {b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}-\frac {\int (c+d \tan (e+f x)) (3 (b B-a (A-C)) d-3 (A b+a B-b C) d \tan (e+f x)) \, dx}{3 d}\\ &=-(b B c+b (A-C) d-a (A c-c C-B d)) x+\frac {(A b+a B-b C) d \tan (e+f x)}{f}-\frac {(b c C-3 b B d-3 a C d) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac {b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}-(-a B c+b c C+b B d+a C d-A (b c+a d)) \int \tan (e+f x) \, dx\\ &=-(b B c+b (A-C) d-a (A c-c C-B d)) x-\frac {(a B c-b c C-b B d-a C d+A (b c+a d)) \log (\cos (e+f x))}{f}+\frac {(A b+a B-b C) d \tan (e+f x)}{f}-\frac {(b c C-3 b B d-3 a C d) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac {b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 1.62, size = 161, normalized size = 1.00 \[ \frac {3 (a+i b) (d-i c) (A+i B-C) \log (-\tan (e+f x)+i)+3 (a-i b) (d+i c) (A-i B-C) \log (\tan (e+f x)+i)+6 d \tan (e+f x) (a B+A b-b C)+\frac {(3 a C d+3 b B d-b c C) (c+d \tan (e+f x))^2}{d^2}+\frac {2 b C \tan (e+f x) (c+d \tan (e+f x))^2}{d}}{6 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

(3*(a + I*b)*(A + I*B - C)*((-I)*c + d)*Log[I - Tan[e + f*x]] + 3*(a - I*b)*(A - I*B - C)*(I*c + d)*Log[I + Ta
n[e + f*x]] + 6*(A*b + a*B - b*C)*d*Tan[e + f*x] + ((-(b*c*C) + 3*b*B*d + 3*a*C*d)*(c + d*Tan[e + f*x])^2)/d^2
 + (2*b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^2)/d)/(6*f)

________________________________________________________________________________________

fricas [A]  time = 0.59, size = 150, normalized size = 0.93 \[ \frac {2 \, C b d \tan \left (f x + e\right )^{3} + 6 \, {\left ({\left ({\left (A - C\right )} a - B b\right )} c - {\left (B a + {\left (A - C\right )} b\right )} d\right )} f x + 3 \, {\left (C b c + {\left (C a + B b\right )} d\right )} \tan \left (f x + e\right )^{2} - 3 \, {\left ({\left (B a + {\left (A - C\right )} b\right )} c + {\left ({\left (A - C\right )} a - B b\right )} d\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 6 \, {\left ({\left (C a + B b\right )} c + {\left (B a + {\left (A - C\right )} b\right )} d\right )} \tan \left (f x + e\right )}{6 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/6*(2*C*b*d*tan(f*x + e)^3 + 6*(((A - C)*a - B*b)*c - (B*a + (A - C)*b)*d)*f*x + 3*(C*b*c + (C*a + B*b)*d)*ta
n(f*x + e)^2 - 3*((B*a + (A - C)*b)*c + ((A - C)*a - B*b)*d)*log(1/(tan(f*x + e)^2 + 1)) + 6*((C*a + B*b)*c +
(B*a + (A - C)*b)*d)*tan(f*x + e))/f

________________________________________________________________________________________

giac [B]  time = 7.34, size = 2918, normalized size = 18.12 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/6*(6*A*a*c*f*x*tan(f*x)^3*tan(e)^3 - 6*C*a*c*f*x*tan(f*x)^3*tan(e)^3 - 6*B*b*c*f*x*tan(f*x)^3*tan(e)^3 - 6*B
*a*d*f*x*tan(f*x)^3*tan(e)^3 - 6*A*b*d*f*x*tan(f*x)^3*tan(e)^3 + 6*C*b*d*f*x*tan(f*x)^3*tan(e)^3 - 3*B*a*c*log
(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan
(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 3*A*b*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)
^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 3*C*b*c*log(4*(tan(f*x)^4*tan(e
)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)
^3*tan(e)^3 - 3*A*a*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*
tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 3*C*a*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*t
an(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 3*B*b*
d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)
/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 18*A*a*c*f*x*tan(f*x)^2*tan(e)^2 + 18*C*a*c*f*x*tan(f*x)^2*tan(e)^2 + 1
8*B*b*c*f*x*tan(f*x)^2*tan(e)^2 + 18*B*a*d*f*x*tan(f*x)^2*tan(e)^2 + 18*A*b*d*f*x*tan(f*x)^2*tan(e)^2 - 18*C*b
*d*f*x*tan(f*x)^2*tan(e)^2 + 3*C*b*c*tan(f*x)^3*tan(e)^3 + 3*C*a*d*tan(f*x)^3*tan(e)^3 + 3*B*b*d*tan(f*x)^3*ta
n(e)^3 + 9*B*a*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f
*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 9*A*b*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e)
 + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 9*C*b*c*log
(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan
(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 9*A*a*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)
^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 9*C*a*d*log(4*(tan(f*x)^4*tan(e
)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)
^2*tan(e)^2 - 9*B*b*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*
tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 6*C*a*c*tan(f*x)^3*tan(e)^2 - 6*B*b*c*tan(f*x)^3*ta
n(e)^2 - 6*B*a*d*tan(f*x)^3*tan(e)^2 - 6*A*b*d*tan(f*x)^3*tan(e)^2 + 6*C*b*d*tan(f*x)^3*tan(e)^2 - 6*C*a*c*tan
(f*x)^2*tan(e)^3 - 6*B*b*c*tan(f*x)^2*tan(e)^3 - 6*B*a*d*tan(f*x)^2*tan(e)^3 - 6*A*b*d*tan(f*x)^2*tan(e)^3 + 6
*C*b*d*tan(f*x)^2*tan(e)^3 + 18*A*a*c*f*x*tan(f*x)*tan(e) - 18*C*a*c*f*x*tan(f*x)*tan(e) - 18*B*b*c*f*x*tan(f*
x)*tan(e) - 18*B*a*d*f*x*tan(f*x)*tan(e) - 18*A*b*d*f*x*tan(f*x)*tan(e) + 18*C*b*d*f*x*tan(f*x)*tan(e) + 3*C*b
*c*tan(f*x)^3*tan(e) + 3*C*a*d*tan(f*x)^3*tan(e) + 3*B*b*d*tan(f*x)^3*tan(e) - 3*C*b*c*tan(f*x)^2*tan(e)^2 - 3
*C*a*d*tan(f*x)^2*tan(e)^2 - 3*B*b*d*tan(f*x)^2*tan(e)^2 + 3*C*b*c*tan(f*x)*tan(e)^3 + 3*C*a*d*tan(f*x)*tan(e)
^3 + 3*B*b*d*tan(f*x)*tan(e)^3 - 2*C*b*d*tan(f*x)^3 - 9*B*a*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e)
 + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) - 9*A*b*c*log(4*(
tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^
2 + 1))*tan(f*x)*tan(e) + 9*C*b*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan
(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) - 9*A*a*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(
f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) + 9*
C*a*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
+ 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) + 9*B*b*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*t
an(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) + 12*C*a*c*tan(f*x)^2*tan(e) + 1
2*B*b*c*tan(f*x)^2*tan(e) + 12*B*a*d*tan(f*x)^2*tan(e) + 12*A*b*d*tan(f*x)^2*tan(e) - 18*C*b*d*tan(f*x)^2*tan(
e) + 12*C*a*c*tan(f*x)*tan(e)^2 + 12*B*b*c*tan(f*x)*tan(e)^2 + 12*B*a*d*tan(f*x)*tan(e)^2 + 12*A*b*d*tan(f*x)*
tan(e)^2 - 18*C*b*d*tan(f*x)*tan(e)^2 - 2*C*b*d*tan(e)^3 - 6*A*a*c*f*x + 6*C*a*c*f*x + 6*B*b*c*f*x + 6*B*a*d*f
*x + 6*A*b*d*f*x - 6*C*b*d*f*x - 3*C*b*c*tan(f*x)^2 - 3*C*a*d*tan(f*x)^2 - 3*B*b*d*tan(f*x)^2 + 3*C*b*c*tan(f*
x)*tan(e) + 3*C*a*d*tan(f*x)*tan(e) + 3*B*b*d*tan(f*x)*tan(e) - 3*C*b*c*tan(e)^2 - 3*C*a*d*tan(e)^2 - 3*B*b*d*
tan(e)^2 + 3*B*a*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan
(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) + 3*A*b*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(
e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) - 3*C*b*c*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3
*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) + 3*A*a*d*log(4*(tan(f*x)^
4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) -
 3*C*a*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(
e) + 1)/(tan(e)^2 + 1)) - 3*B*b*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan
(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) - 6*C*a*c*tan(f*x) - 6*B*b*c*tan(f*x) - 6*B*a*d*tan(f*x) - 6*
A*b*d*tan(f*x) + 6*C*b*d*tan(f*x) - 6*C*a*c*tan(e) - 6*B*b*c*tan(e) - 6*B*a*d*tan(e) - 6*A*b*d*tan(e) + 6*C*b*
d*tan(e) - 3*C*b*c - 3*C*a*d - 3*B*b*d)/(f*tan(f*x)^3*tan(e)^3 - 3*f*tan(f*x)^2*tan(e)^2 + 3*f*tan(f*x)*tan(e)
 - f)

________________________________________________________________________________________

maple [B]  time = 0.02, size = 334, normalized size = 2.07 \[ \frac {C b d \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {B \left (\tan ^{2}\left (f x +e \right )\right ) b d}{2 f}+\frac {C \left (\tan ^{2}\left (f x +e \right )\right ) a d}{2 f}+\frac {C \left (\tan ^{2}\left (f x +e \right )\right ) b c}{2 f}+\frac {A b d \tan \left (f x +e \right )}{f}+\frac {B a d \tan \left (f x +e \right )}{f}+\frac {B b c \tan \left (f x +e \right )}{f}+\frac {C a c \tan \left (f x +e \right )}{f}-\frac {C b d \tan \left (f x +e \right )}{f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A a d}{2 f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A b c}{2 f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B a c}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B b d}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a C d}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) C b c}{2 f}+\frac {A \arctan \left (\tan \left (f x +e \right )\right ) a c}{f}-\frac {A \arctan \left (\tan \left (f x +e \right )\right ) b d}{f}-\frac {B \arctan \left (\tan \left (f x +e \right )\right ) a d}{f}-\frac {B \arctan \left (\tan \left (f x +e \right )\right ) b c}{f}-\frac {C \arctan \left (\tan \left (f x +e \right )\right ) a c}{f}+\frac {C \arctan \left (\tan \left (f x +e \right )\right ) b d}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)

[Out]

1/3/f*C*b*d*tan(f*x+e)^3+1/2/f*B*tan(f*x+e)^2*b*d+1/2/f*C*tan(f*x+e)^2*a*d+1/2/f*C*tan(f*x+e)^2*b*c+1/f*A*b*d*
tan(f*x+e)+1/f*B*a*d*tan(f*x+e)+1/f*B*b*c*tan(f*x+e)+1/f*C*a*c*tan(f*x+e)-1/f*C*b*d*tan(f*x+e)+1/2/f*ln(1+tan(
f*x+e)^2)*A*a*d+1/2/f*ln(1+tan(f*x+e)^2)*A*b*c+1/2/f*ln(1+tan(f*x+e)^2)*B*a*c-1/2/f*ln(1+tan(f*x+e)^2)*B*b*d-1
/2/f*ln(1+tan(f*x+e)^2)*a*C*d-1/2/f*ln(1+tan(f*x+e)^2)*C*b*c+1/f*A*arctan(tan(f*x+e))*a*c-1/f*A*arctan(tan(f*x
+e))*b*d-1/f*B*arctan(tan(f*x+e))*a*d-1/f*B*arctan(tan(f*x+e))*b*c-1/f*C*arctan(tan(f*x+e))*a*c+1/f*C*arctan(t
an(f*x+e))*b*d

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 151, normalized size = 0.94 \[ \frac {2 \, C b d \tan \left (f x + e\right )^{3} + 3 \, {\left (C b c + {\left (C a + B b\right )} d\right )} \tan \left (f x + e\right )^{2} + 6 \, {\left ({\left ({\left (A - C\right )} a - B b\right )} c - {\left (B a + {\left (A - C\right )} b\right )} d\right )} {\left (f x + e\right )} + 3 \, {\left ({\left (B a + {\left (A - C\right )} b\right )} c + {\left ({\left (A - C\right )} a - B b\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left ({\left (C a + B b\right )} c + {\left (B a + {\left (A - C\right )} b\right )} d\right )} \tan \left (f x + e\right )}{6 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/6*(2*C*b*d*tan(f*x + e)^3 + 3*(C*b*c + (C*a + B*b)*d)*tan(f*x + e)^2 + 6*(((A - C)*a - B*b)*c - (B*a + (A -
C)*b)*d)*(f*x + e) + 3*((B*a + (A - C)*b)*c + ((A - C)*a - B*b)*d)*log(tan(f*x + e)^2 + 1) + 6*((C*a + B*b)*c
+ (B*a + (A - C)*b)*d)*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 8.84, size = 153, normalized size = 0.95 \[ \frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {A\,a\,d}{2}+\frac {A\,b\,c}{2}+\frac {B\,a\,c}{2}-\frac {B\,b\,d}{2}-\frac {C\,a\,d}{2}-\frac {C\,b\,c}{2}\right )}{f}-x\,\left (A\,b\,d-A\,a\,c+B\,a\,d+B\,b\,c+C\,a\,c-C\,b\,d\right )+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {B\,b\,d}{2}+\frac {C\,a\,d}{2}+\frac {C\,b\,c}{2}\right )}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (A\,b\,d+B\,a\,d+B\,b\,c+C\,a\,c-C\,b\,d\right )}{f}+\frac {C\,b\,d\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x))*(c + d*tan(e + f*x))*(A + B*tan(e + f*x) + C*tan(e + f*x)^2),x)

[Out]

(log(tan(e + f*x)^2 + 1)*((A*a*d)/2 + (A*b*c)/2 + (B*a*c)/2 - (B*b*d)/2 - (C*a*d)/2 - (C*b*c)/2))/f - x*(A*b*d
 - A*a*c + B*a*d + B*b*c + C*a*c - C*b*d) + (tan(e + f*x)^2*((B*b*d)/2 + (C*a*d)/2 + (C*b*c)/2))/f + (tan(e +
f*x)*(A*b*d + B*a*d + B*b*c + C*a*c - C*b*d))/f + (C*b*d*tan(e + f*x)^3)/(3*f)

________________________________________________________________________________________

sympy [A]  time = 0.50, size = 326, normalized size = 2.02 \[ \begin {cases} A a c x + \frac {A a d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {A b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - A b d x + \frac {A b d \tan {\left (e + f x \right )}}{f} + \frac {B a c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - B a d x + \frac {B a d \tan {\left (e + f x \right )}}{f} - B b c x + \frac {B b c \tan {\left (e + f x \right )}}{f} - \frac {B b d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {B b d \tan ^{2}{\left (e + f x \right )}}{2 f} - C a c x + \frac {C a c \tan {\left (e + f x \right )}}{f} - \frac {C a d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {C a d \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {C b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {C b c \tan ^{2}{\left (e + f x \right )}}{2 f} + C b d x + \frac {C b d \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {C b d \tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\relax (e )}\right ) \left (c + d \tan {\relax (e )}\right ) \left (A + B \tan {\relax (e )} + C \tan ^{2}{\relax (e )}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Piecewise((A*a*c*x + A*a*d*log(tan(e + f*x)**2 + 1)/(2*f) + A*b*c*log(tan(e + f*x)**2 + 1)/(2*f) - A*b*d*x + A
*b*d*tan(e + f*x)/f + B*a*c*log(tan(e + f*x)**2 + 1)/(2*f) - B*a*d*x + B*a*d*tan(e + f*x)/f - B*b*c*x + B*b*c*
tan(e + f*x)/f - B*b*d*log(tan(e + f*x)**2 + 1)/(2*f) + B*b*d*tan(e + f*x)**2/(2*f) - C*a*c*x + C*a*c*tan(e +
f*x)/f - C*a*d*log(tan(e + f*x)**2 + 1)/(2*f) + C*a*d*tan(e + f*x)**2/(2*f) - C*b*c*log(tan(e + f*x)**2 + 1)/(
2*f) + C*b*c*tan(e + f*x)**2/(2*f) + C*b*d*x + C*b*d*tan(e + f*x)**3/(3*f) - C*b*d*tan(e + f*x)/f, Ne(f, 0)),
(x*(a + b*tan(e))*(c + d*tan(e))*(A + B*tan(e) + C*tan(e)**2), True))

________________________________________________________________________________________